import { SupplierRequest } from '@/plugins/supplier-request'

// 核查计划 - 获取合格供应商列表
export const querySupplierListService = (data, loadingFn) => SupplierRequest({
  url: '/supervision/supplier/listData',
  type: 'post',
  data,
  loadingFn
});

// 核查计划 - 列表查询
export const queryCheckPlanListService = (data, loadingFn) => SupplierRequest({
  url: '/supervision/plan-bill/pageData',
  type: 'post',
  data,
  loadingFn
});

// 核查计划 - 获取核查供应商明细
export const queryCheckSupplierDetailService = (data, loadingFn) => SupplierRequest({
  url: '/supervision/plan-bill/pageDetail',
  type: 'post',
  data,
  loadingFn
});

// 核查计划 - 导出
export const exportCheckPlanService = (data, loadingFn) => SupplierRequest({
  url: '/supplier/export/exportSupervisionPlan',
  type: 'post',
  data,
  loadingFn,
  isExport: true
});

// 核查计划 - 删除计划
export const deletePlanService = (data, loadingFn) => SupplierRequest({
  url: `/supervision/plan-bill/delete/${data.planId}`,
  type: 'get',
  data,
  loadingFn
});

// 核查计划 - 暂存
export const stashCheckPlanService = (data, loadingFn) => SupplierRequest({
  url: '/supervision/plan-bill/stash',
  type: 'post',
  data,
  loadingFn
});

// 核查计划 - 提交
export const submitCheckPlanService = (data, loadingFn) => SupplierRequest({
  url: '/supervision/plan-bill/submit',
  type: 'post',
  data,
  loadingFn
});

// 修改核查方式 - 提交
export const submitEditCheckTypeService = (data, loadingFn) => SupplierRequest({
  url: `/supervision/plan-bill/updateCheckType/${data.planId}`,
  type: 'post',
  data: data.list,
  loadingFn
});

// 核查计划 - 审批流
export const getOaUrlService = (data, loadingFn) => SupplierRequest({
  url: '/workflow/jump-url',
  type: 'post',
  data,
  loadingFn
});

// 核查计划 - 取回
export const retrieveWorkFlowService = (data, loadingFn) => SupplierRequest({
  url: '/workflow/retrieve',
  type: 'post',
  data,
  loadingFn
});

// 新增计划 - 批量导出
export const batchExportPlanService = (data, loadingFn) => SupplierRequest({
  url: '/supplier/export/exportSupervisionSupplier',
  type: 'post',
  data,
  loadingFn,
  isExport: true
});
